<style>
    .file-upload-container {
        text-align: center;
    }

    .file-input {
        display: none;
    }
    .file-name ul {
        list-style-type: none;
        padding: 0;
    }
    .upload-btn {
        padding: 10px 20px;
        background-color: #4caf50;
        color: #fff;
        border: none;
        border-radius: 4px;
        cursor: pointer;
        font-size: 16px;
    }

    .upload-btn:hover {
        background-color: #45a049;
    }

    .file-name {
        margin-top: 10px;
        font-size: 14px;
        color: #555;
    }

    .upload-progress {
        margin-top: 20px;
        width: 300px;
    }

    .progress-bar {
        width: 0;
        height: 20px;
        background-color: #4caf50;
        border-radius: 4px;
        text-align: center;
        line-height: 20px;
        color: #fff;
    }
    input[type="file"]{
        display: none;
    }
    .confirm-btn {
        padding: 10px 20px;
        background-color: #007BFF;
        color: #fff;
        border: none;
        border-radius: 4px;
        cursor: pointer;
        font-size: 16px;
        margin-top: 10px;
    }

    .confirm-btn:hover {
        background-color: #0056b3;
    }
    #information{
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    .selectDiv {
        width: 130px;
        display: inline-block;
        padding: 8px;
        font-size: 14px;
        line-height: 1.5;
        cursor: pointer;
        border: 1px solid #dcdfe6;
        border-radius: 4px;
        outline: none;
        transition: border-color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
    }

    .selectDiv:hover,
    .selectDiv:focus {
        border-color: #409eff;
    }

    .selectDiv:focus {
        box-shadow: 0 0 0 2px rgba(64, 158, 255, 0.2);
    }
    .alert{
        color: #9E1B0E;
    }
    .fail-box{
        margin-top: 20px;
    }
    table {
        width: 100%;
        border-collapse: collapse;
        margin-top: 20px;
    }

    th, td {
        border: 1px solid #dddddd;
        text-align: left;
        padding: 8px;
    }

    th {
        background-color: #f2f2f2;
    }
</style>
<div id="information">
    <div style="margin-bottom: 20px;">
        <label for="datepicker">选择快递:</label>
        <select class="selectDiv" v-model="kuaidi" placeholder="请选择">
            <option v-for="item in kuaidiList" v-text="item.name" :value="item.code">
            </option>
        </select>
        <span class="alert" v-if="kuaidiShow" v-text="kauidiAlert"></span>
    </div>
    <div class="file-upload-container">
        <label for="fileInput" class="upload-btn">选择文件</label>
        <input type="file" id="fileInput" class="file-input" multiple @change="handleFileChange">
        <div class="file-name" v-if="selectedFiles.length > 0">
            选择的文件
            <ul>
                <li v-for="file in selectedFiles" :key="file.name" v-text="file.name"></li>
            </ul>
        </div>
        <div class="upload-progress" >
            <div class="progress-bar" :style="{ width: uploadPercentage + '%' }" >{{ uploadPercentage }}%</div>
        </div>

    </div>
    <button class="confirm-btn" v-if="uploadPercentage==100" @click="confirm">确定</button>
    <div v-if="failShow" class="fail-box">
        <span>成功数量:</span><span v-text="fail.successNum"></span>
        <table>
            <thead>
            <tr>
                <th>订单号</th>
                <th>订单状态</th>
                <th>支付单号</th>
                <th>提示</th>
            </tr>
            </thead>
            <tbody>
            <tr v-for="item in fail.fail">
                <td v-text="item.order_no"></td>
                <td>
                    {{ item.state === 1 ? '待支付' :
                    item.state === 2 ? '待发货' :
                    item.state === 3 ? '待收货' :
                    item.state === 4 ? '待评论' :
                    item.state === 5 ? '售后订单(已弃用)' :
                    item.state === 6 ? '已完成' :
                    item.state === 7 ? '已取消' : '未知状态' }}
                </td>
                <td v-text="item.pay_no"></td>
                <td v-text="item.msg"></td>
            </tr>
            </tbody>
        </table>
    </div>
</div>
